package com.xinqi.common.mybatis.injector.enums;

/**
 * MybatisPlus 支持 SQL 方法
 *
 * @author linkai
 * @date 2019/07/16
 */
public enum ExtSqlMethod {

    /**
     * 修改
     */
    UPDATE_ALL_COLUMN_BY_ID("updateAllColumnById", "根据ID 选择修改数据",
        "<script>\nUPDATE %s %s WHERE %s=#{%s} %s\n</script>"),

    SELECT_BY_ID_WITH_DELETED("selectByIdWithDeleted", "根据 ID 查询数据, 无视逻辑删除字段",
        "<script>\nSELECT %s FROM %s WHERE %s=#{%s}\n</script>");

    private final String method;

    private final String desc;

    private final String sql;

    ExtSqlMethod(String method, String desc, String sql) {
        this.method = method;
        this.desc = desc;
        this.sql = sql;
    }

    public String getMethod() {
        return method;
    }

    public String getDesc() {
        return desc;
    }

    public String getSql() {
        return sql;
    }

}
